package com.edu.demo.quartz.trigger;

import org.quartz.CronScheduleBuilder;
import org.quartz.Trigger;
import org.quartz.TriggerBuilder;

public class SimpleGetTrigger {
    public static Trigger createTrigger() {
        Trigger trigger = TriggerBuilder.newTrigger()
                .withIdentity("girl", "call") //触发器的名称和分组
                //cron 11点到12点，每5秒执行一次
                .withSchedule(CronScheduleBuilder.cronSchedule("0/10 * 11-12 * * ?"))
                .startNow() //立即触发
                .build();
        return trigger;
    }
}
